/**
 * 
 */
package core.modules;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.view.Gravity;
import android.widget.TextView;

import com.project.common.screens.Login;
import com.project.trac.R;

/**
 * @author glennarnobit
 *
 */
public class Institute extends Activity {
	
	private static int ROLE_ID;
	private static int USER_ID;
	private static int SUBJECT_ID;
	private static String USERNAME;
	private static String PASSWORD;
	private static String FIRSTNAME;
	
	private TextView textView;
	
	public void setRole(String rid) {
		Institute.ROLE_ID = Integer.valueOf(rid);
	}
	
	public int getRole() {
		return ROLE_ID;
	}
	
	public void setUserID(String uid) {
		Institute.USER_ID = Integer.valueOf(uid);
	}
	
	public int getUserID() {
		return USER_ID;
	}
	
	
	public void setSubjectID(String sid) {
		Institute.SUBJECT_ID = Integer.valueOf(sid);
	}
	
	public int getSubjectID() {
		return SUBJECT_ID;
	}
	
	public void setUsername(String username) {
		Institute.USERNAME = username;
	}
	
	public String getUsername() {
		return USERNAME;
	}
	
	public void setPassword(String password) {
		Institute.PASSWORD = password;
	}
	
	public String getPassword() {
		return PASSWORD;
	}
	
	public void setFirstName(String firstname) {
		Institute.FIRSTNAME = firstname;
	}
	
	public String getFirstName() {
		return FIRSTNAME;
	}


	public void Logout(final Activity activity) {

		textView = new TextView(activity);
		textView.setText("You will be logged out of the system");
		textView.setTextAppearance(activity.getApplicationContext(),
				R.style.alert_message);
		textView.setGravity(Gravity.CENTER_HORIZONTAL);

		new AlertDialog.Builder(activity)
				.setTitle("Information")
				.setView(textView)
				.setIcon(android.R.drawable.ic_dialog_info)
				.setCancelable(false)
				.setPositiveButton(android.R.string.yes,
						new DialogInterface.OnClickListener() {
							public void onClick(DialogInterface dialog, int id) {
								activity.startActivity(new Intent(activity, Login.class));
								activity.finish();
							}
						})
				.setNegativeButton(android.R.string.no,
						new DialogInterface.OnClickListener() {
							public void onClick(DialogInterface dialog, int id) {
								dialog.cancel();
							}
						}).create().show();
	}

	
}
